Atari CAD-3D to RAW Triangles

cad3d2raw is a simple filter for converting Atari CAD-3D files (created by CAD-3D 2.x, CyberSculpt, and various tools from Lexicor and others) to the RAW triangle format supported by raw2pov. This is intended as a method of getting CAD-3D objects into your POV-Ray scenes for raytracing; a nice side-effect is that raw2pov can output Vivid and Polyray scene files as well, so users of those raytracers will be able to use CAD-3D objects in their scenes as easily as POV-Ray users.

cad3d2raw was written from scratch by Chris Herborth (cherborth@semprini.waterloo-rdp.on.ca), who retains all rights to the program and its source code; the source code and cad3d2raw binaries created from the source code may be freely distributed. You can use the source code in your own programs as long as I am given credit, and you can compile and use the cad3d2raw program for whatever purposes you'd like. If you sell cad3d2raw to anyone, you're a jerk. Contact me if you'd like to include cad3d2raw in something like a CD-ROM collection or a shareware/Public Domain collection.

If you use cad3d2raw for any commercial purposes, or if you use it to create any nice scenes, I would appreciate it if you'd send me a copy of the image you've rendered, preferably in JPEG format.

Compiling cad3d2raw

To compile cad3d2raw:

  1. Edit the Makefile. You will probably have to change CC and possibly CFLAGS to match what your compiler expects; things like Microsoft C and Borland C seem to go out of their way to have incompatible command-line switches.
  2. If you are compiling for a little-endian CPU (ie, Intel, some MIPS, VAX, probably one or two blasphemous others), add -DLITTLE_ENDIAN to CFLAGS; the code already takes care of converting the big-endian CAD-3D files into little-endedness for you.
  3. If you are compiling for an operating system that insists on having a file's extension decide what an executable is, you'll need to change PROGRAM. DOS and OS/2 need .exe, Atari TOS needs .ttp (unless you use the Minix filesystem under MiNT).
  4. Type make and hit return. If you don't have a make program, get one.
  5. In a short time, you should have a cad3d2raw executable to fondle and love... enjoy!

Using cad3d2raw

cad3d2raw is fairly easy to use, and has only a few options. Usage is:

cad3d2raw [options] input.3d2 [output.raw]

where the options and the output filename are optional.

The available options include:

-c
Use the colours from the CAD-3D file (makes a Fractint RAW file); this will preserve the object colours. Remember to add -fc to the raw2pov command line if you use this!
-b
Use the colour base from the CAD-3D file (makes a Fractint RAW file); contrary to the usage message in cad3d2raw, this doesn't really work better... it seems to produce about the same effect as using -c. This is a bug/feature and will probably go away in the next version, if there is one. Remember to add -fc to the raw2pov command line if you use this!
-v
Produce verbose output. This is good if you've got a slow manchine and want some sort of indication that cad3d2raw is actually doing some sort of work.
-d
Produce debugging output (ie, extra-verbose). This isn't too useful unless you think you've got a corrupt CAD-3D file.

Less useful options include:

-h
Print the usage message.
-?
Same as -h.
-V
Prints version info. On a some systems, ident cad3d2raw will give you the same information.

Sources of CAD-3D Objects

Lots of great CAD-3D objects can be found on these Internet FTP sites:

There are also a tonne of CAD-3D objects available on GEnie, and probably on CompuServ as well.

If you run a BBS that has CAD-3D objects available, let me know, and I'll include it here in future releases.

Other Stuff

Another great source of utilities for POV-Ray is Marius Watz's POV-Ray Utilities page.